﻿using EasyCaching.Core.Configurations;
using EasyCaching.InMemory;
using LJ.Abstractions.Pack;
using LJ.Cache.EasyCaching.Internal;
using LJ.Cache.EasyCaching.Pack;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LJ.Cache.EasyCaching.InMemory.Pack;


public abstract class CacheEasyCachingInMemoryPackBase :PackBase, ICacheEasyCachingPack
{
    public override void Add(IPackContext packContext)
    {
        packContext.DependencyManager.ServiceCollection.AddTransient<ICache, EasyCachingCache>();

        packContext.DependencyManager.ServiceCollection.AddEasyCaching(a =>
        {
           a.UseInMemory(EasyCachingConst.Key);
        });
    }
}
